<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>公告 - ${web.wtitle}</title>
<meta name="keywords" content="${web.wkeywords}" />
<meta name="description" content="${web.wdescription}" />
<%@ include file="common/head.jsp" %>
<!--[if lt IE 9]>
<script src="js/modernizr.js"></script>
<![endif]-->
</head>
<body onload="query(1)">
<!--top begin-->
<jsp:include page="top.jsp"></jsp:include>
<!-- top end -->
<article> 
  <!--lbox begin-->
  <div class="lbox">
    <div class="whitebg lanmu"> 
    <img src="/images/ad02.jpg">
      <h1>公告</h1>
      <p>公告</p>
    </div>
    
    <div class="whitebg bloglist" id="dataList" >

          
    </div>
  <div  class="pagelist"  id="pageHTML2">
            </div>

    <!--bloglist end--> 
  </div>
  <div class="rbox">
      <!-- 点击排行 start -->
 <jsp:include page="clickhit.jsp"></jsp:include>
 <!-- 点击排行 end  -->

<!-- tuijian start -->
<jsp:include page="tuijian.jsp"></jsp:include>
  <!-- tuijian end -->
    <jsp:include page="ad6.jsp"></jsp:include>
 
    <!--  cloud 标签云-->
    <jsp:include page="Cloudy.jsp"></jsp:include>
        <!--  -->
    <!-- 猜你喜欢 start -->
<jsp:include page="GuessYouLike.jsp"></jsp:include>
    <!-- 猜你喜欢 end -->
    <jsp:include page="ad7.jsp"></jsp:include>
<jsp:include page="web.jsp"></jsp:include>
  <jsp:include page="toobar.jsp"></jsp:include>
  </div>
</article>
<!-- footer start -->
<jsp:include page="footer.jsp"></jsp:include>
  <!-- footer end -->
</body>
<script type="text/javascript">
	function query(page) {
	
		//请求的url
		var dataUrl = "/advice/adviceBaiduList";

	
		
				$.ajax({
					async : true,//设置为异步，如果设置为同步，必须等ajax请求完毕之后，再执行进行下面的操作
					url : dataUrl,       //请求的url
					data : {"page":page},    //要传递的参数
					dataType : "json",//返回的数据格式为json
					cache : false,//不设置缓存
					type : "POST",//提交方式post
					//请求出错调用的方法
					error : function(textStatus, errorThrown) {
						alert("ajax请求失败！");
					},
					//请求之前的方法
					beforeSend : function() {
						//alert("请求前执行的方法！通常放一张加载的图片");
					},
					//请求成功的方法，data为返回的数据
					success : function(data, textStatus) {
						var innerHtml = " <h2 class='htitle'>最新公告</h2>";
						innerHtml +="<ul>";
	
						$.each(data.list, function(index,advice) {
						
				  <!--单图-->
      	innerHtml += "<li>";
      innerHtml +="  <h3 class='blogtitle'><a href='/noticecontent.html?id="+advice.advid+"' target='_blank'>"+advice.advtitle+"</a></h3>";
     innerHtml += "<span class='blogpic imgscale'><i><a href='/noticecontent.html?id="+advice.advid+"'>"+advice.advtitle+"</a></i><a href='/noticecontent.html?id="+advice.advid+"' title='"+advice.advtitle+"'><img src='"+advice.advimg+"' alt='"+advice.advdescribe+"'></a></span>";
    innerHtml += "<p class='blogtext'>"+advice.advdescribe+"</p>";
           innerHtml += "<p class='bloginfo'><i class='avatar'><a href='/about.html' target=_blank><img src='/images/avatar.jpg' border=0 width='30' height='30' alt=''></a></i><span>滕一帆</span><span>"+formatTime(advice.updatetime,"yyyy-MM-dd hh:mm:ss")+"</span><span>【<a href='/noticecontent.html?id="+advice.advid+"'>"+advice.advtitle+"</a>】</span></p>";
        innerHtml += "<a href='/noticecontent.html?id="+advice.advid+"' class='viewmore'>阅读更多</a> ";
        							innerHtml += "</li>";
        
						});
							innerHtml += " </ul>";
							
						$("#dataList").html(innerHtml);
				
						$("#pageHTML2").html(data.pageHtml2);					
					}
				});
	}


	//格式化时间
		function formatTime(datetime, fmt) {
			if (datetime == null || datetime == 0) {
				return "";
			}
			if (parseInt(datetime) == datetime) {
				if (datetime.length == 10) {
					datetime = parseInt(datetime) * 1000;
				} else if (datetime.length == 13) {
					datetime = parseInt(datetime);
				}
			}
			datetime = new Date(datetime);
			var o = {
				"M+" : datetime.getMonth() + 1, //月份   
				"d+" : datetime.getDate(), //日   
				"h+" : datetime.getHours(), //小时   
				"m+" : datetime.getMinutes(), //分   
				"s+" : datetime.getSeconds(), //秒   
				"q+" : Math.floor((datetime.getMonth() + 3) / 3), //季度   
				"S" : datetime.getMilliseconds()
			//毫秒   
			};
			if (/(y+)/.test(fmt))
				fmt = fmt.replace(RegExp.$1, (datetime.getFullYear() + "")
						.substr(4 - RegExp.$1.length));
			for ( var k in o)
				if (new RegExp("(" + k + ")").test(fmt))
					fmt = fmt.replace(RegExp.$1,
							(RegExp.$1.length == 1) ? (o[k]) : (("00" + o[k])
									.substr(("" + o[k]).length)));
			return fmt;
		}

</script>
</html>
